import request from '@/utils/request'

export function add(data) {
  return request({
    url: 'api/administrativeOffice',
    method: 'post',
    data
  })
}

export function del(ids) {
  return request({
    url: 'api/administrativeOffice/',
    method: 'delete',
    data: ids
  })
}

export function edit(data) {
  return request({
    url: 'api/administrativeOffice',
    method: 'put',
    data
  })
}

export function getNameAndId() {
  return request({
    url: 'api/administrativeOffice/getNameAndId',
    method: 'get'
  })
}

export function getOfficeByHpId(id, pageNum, pageSize) {
  return request({
    url: 'api/administrativeOffice/getOfficeByhpId/' + id + '/' + pageNum + '/' + pageSize,
    method: 'get'
  })
}

export function getByName(data) {
  return request({
    url: 'api/administrativeOffice/getByName/' + data,
    method: 'get'
  })
}

export function addOffice(data) {
  return request({
    url: 'api/administrativeOffice',
    method: 'post',
    data: data
  })
}

export function updateOffice(data) {
  return request({
    url: 'api/administrativeOffice',
    method: 'put',
    data: data
  })
}

export function delOffice(data) {
  return request({
    url: 'api/administrativeOffice',
    method: 'delete',
    data: data
  })
}

export default {add, edit, del, getNameAndId, getOfficeByHpId, addOffice, updateOffice, delOffice}
